package com.ruoyi.teach.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbChapterTestMapper;
import com.ruoyi.teach.domain.NbChapterTest;
import com.ruoyi.teach.service.INbChapterTestService;

/**
 * 章节/练习题Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbChapterTestServiceImpl implements INbChapterTestService 
{
    @Autowired
    private NbChapterTestMapper nbChapterTestMapper;

    /**
     * 查询章节/练习题
     * 
     * @param id 章节/练习题主键
     * @return 章节/练习题
     */
    @Override
    public NbChapterTest selectNbChapterTestById(Long id)
    {
        return nbChapterTestMapper.selectNbChapterTestById(id);
    }

    /**
     * 查询章节/练习题列表
     * 
     * @param nbChapterTest 章节/练习题
     * @return 章节/练习题
     */
    @Override
    public List<NbChapterTest> selectNbChapterTestList(NbChapterTest nbChapterTest)
    {
        return nbChapterTestMapper.selectNbChapterTestList(nbChapterTest);
    }

    /**
     * 新增章节/练习题
     * 
     * @param nbChapterTest 章节/练习题
     * @return 结果
     */
    @Override
    public int insertNbChapterTest(NbChapterTest nbChapterTest)
    {
        return nbChapterTestMapper.insertNbChapterTest(nbChapterTest);
    }

    /**
     * 修改章节/练习题
     * 
     * @param nbChapterTest 章节/练习题
     * @return 结果
     */
    @Override
    public int updateNbChapterTest(NbChapterTest nbChapterTest)
    {
        return nbChapterTestMapper.updateNbChapterTest(nbChapterTest);
    }

    /**
     * 批量删除章节/练习题
     * 
     * @param ids 需要删除的章节/练习题主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterTestByIds(Long[] ids)
    {
        return nbChapterTestMapper.deleteNbChapterTestByIds(ids);
    }

    /**
     * 删除章节/练习题信息
     * 
     * @param id 章节/练习题主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterTestById(Long id)
    {
        return nbChapterTestMapper.deleteNbChapterTestById(id);
    }
}
